/**
 * 
 * @param {number} total 
 * @param {number} num 
 * @returns {number[]}
 */
function hongbao(total, num){
    const result = [];
    let restAmount = total; // 剩余金额
    let restNum = num; // 剩余人数
    // 平均 随机
    for(let i = 0; i < num - 1; i++){
        let amount = Math.random(restAmount / restNum * 2).toFixed(2);
        restAmount -= amount;
        restNum--;
        result.push(amount);
    }
    result.push(restAmount.toFixed(2));
    return result;
}